<template>
	<view>
		<!-- 设置圆角 -->
		<uni-search-bar :radius="100" maxlength="6" :placeholder="text"  @confirm="search"></uni-search-bar>
	</view>
</template>

<script>
import uniSearchBar from '../../components/uni-search-bar/uni-search-bar.vue';
import { mapMutations } from 'vuex';
export default {
	components: { uniSearchBar },
	data() {
		return {
			text:''
		};
	},
	onLoad() {
		this.text = this.$store.state.serviceSearchBarText;
	},
	methods: {
		search(e){
			this.changeServiceSearchBarText(e.value)
			uni.reLaunch({
				url:'category'
			})
		},
		...mapMutations(['changeServiceSearchBarText']),
	}
};
</script>

<style></style>
